#include <iostream>

template<typename... Elements>
class Typelist {};

template<typename List>
class PopFrontT;

template<typename Head, typename... Tail>
class PopFrontT<Typelist<Head, Tail...>> {
public:
using Type = Typelist<Tail...>;
};

template<typename List>
using PopFront = typename PopFrontT<List>::Type;

///////////////////////////

template<typename List>
class FrontT {
public:
  using Type = List;
};

template<typename Head, typename... Tail>
class FrontT<Typelist<Head, Tail...>> {
  public:
  using Type = Head;
};

// template<typename List>
// class NthElementT<List, 0> : public FrontT<List>
// { };

// template<typename List, unsigned N>
// class NthElementT : public NthElementT<PopFront<List>, N-1>
// {};

// //////////////////////////

// using SignedIntegralTypes =
// Typelist<signed char, short, int, long, long long>;

// template<typename List, unsigned N>
// using NthElement = typename NthElementT<List, N>::Type;

// int main() {
//   using ClassType = NthElement<SignedIntegralTypes, 1>;
//   ClassType x;
//   std::cout << "x: " << x << " typeid(x): " << typeid(x).name() << '\n';
//   return 0;
// }